Skip to content

Enable more linters#307

Draft
obbardc wants to merge 13 commits into
mainfrom
wip/obbardc/add-more-linters
Draft

Enable more linters#307
obbardc wants to merge 13 commits into
mainfrom
wip/obbardc/add-more-linters

Conversation

@obbardc
Copy link
Copy Markdown
Member

@obbardc obbardc commented May 2, 2026

No description provided.

Comment thread machine.go
@obbardc obbardc added this to the v0.0.13 milestone May 2, 2026
@obbardc obbardc self-assigned this May 3, 2026
Comment thread .golangci.yml
@obbardc

This comment was marked as resolved.

obbardc added 7 commits May 11, 2026 09:40
Enable ineffassign, unused, unconvert, bodyclose, copyloopvar, nilerr,
nilnil, wastedassign, maintidx, nakedret and predeclared linters. No
code changes are required as the codebase already satisfies these
linters.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
@obbardc obbardc force-pushed the wip/obbardc/add-more-linters branch from d75dec7 to 52763ea Compare May 11, 2026 08:43
obbardc added 3 commits May 16, 2026 00:37
Remove the comments exclusion preset so revive enforces package-level
and exported-identifier documentation.

Fixes: #304
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Extract applyMachineOptions from main, flatten GetDeterminedVersion
with early returns and simplify checkStreamsMatch to use io.ReadAll.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Extract writeCLibraries, writeCoreDirectories, writeMergedUsrPaths,
writeSystemdServices, writeExtraContent and fillInitrd helpers to
reduce cyclomatic complexity below the configured maximum of 10.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
@obbardc obbardc force-pushed the wip/obbardc/add-more-linters branch from 52763ea to af0e5e3 Compare May 15, 2026 23:37
@obbardc

This comment was marked as resolved.

Comment thread cmd/fakemachine/main.go

// Puts in a format that is compatible with output of os.Environ()
EnvironString := []string{}
EnvironString := make([]string, 0, len(EnvironVars))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is prealloc really a useful linter ?

Comment thread cmd/fakemachine/main.go
@@ -1,3 +1,4 @@
// Package main is the entry point for the fakemachine command-line tool.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rework these comments to better describe the functions.

obbardc added 3 commits May 16, 2026 00:50
This reverts commit af0e5e3.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
This reverts commit 0fcfbca.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
… complexity

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
@obbardc obbardc requested a review from sjoerdsimons May 15, 2026 23:53
@obbardc
Copy link
Copy Markdown
Member Author

obbardc commented May 15, 2026

@sjoerdsimons ready for a first review on this to check shape etc. See my existing comments. I don't think there's gonna be a huge deal left for me to work out here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant